<?php

include('../../include/functions.inc.php');
include('../../include/maintenance.inc.php');

if (!isset($_SESSION['mStudents'])) {
    $mStudents = new Maintenance();

    $mStudents->windowTitle = 'Mantenimiento de Estudiantes';
    $mStudents->newUrlPage = 'new.php';
    $mStudents->editUrlPage = 'edit.php';
    $mStudents->saveNewUrlPage = 'data.php?operation=s';
    $mStudents->updateUrlPage = 'data.php?operation=u';
    $mStudents->deleteUrlPage = 'data.php?operation=d';
    $mStudents->listJsonUrl = 'estudents.php';
    $mStudents->path = '../../';
    $mStudents->staticsUrl = 'index.php?statics=true';
    $mStudents->editUrlParams = array("CARNET" => "CARNET");
    $mStudents->deleteUrlParams = array("ID" => "CARNET");
    $mStudents->table = "cllg_student";
    $mStudents->globalCallBackJs = "config.js.php";
    $mStudents->validations = array("required,ID,Carnet es Requerido",
        "required,FIRST_NAME,1er Nombre es Requerido",
        "required,LAST_NAME,Apellido es Requerido",
        "required,BIRTH_DATE,Fecha Nacimiento es Requerido");
    $mStudents->loadDynValidations($db);
    $mStudents->panels = TRUE;
    $_SESSION['mStudents'] = serialize($mStudents);
} else {
    $mStudents = unserialize($_SESSION['mStudents']);
}

if (!isEmpty(getParam('statics'))) {
    $mStudents->statics(count($db->query_select('cllg_student')));
} else {
    $mStudents->build();
}
?>